/**
 * 工时功能 api 封装
 *
 * @Author:    yjg
 * @Date:      2024-09-09 11:02:13
 * @Copyright  v1.0
 */
import { postRequest, getRequest, postDownload } from '/@/lib/axios';

export const workingHoursApi = {

  /**
   * 分页查询  @author  yjg
   */
  queryPage : (param) => {
    return postRequest('/workingHours/queryPage', param);
  },
  
  /**
   * 审核页面分页查询  @author  yjg
   */
  queryAllowPage : (param) => {
    return postRequest('/workingHoursAllow/queryPage', param);
  },
  
  /**
   * 加班审批分页查询  @author  yjg
   */
  queryWorkingOvertimeAllowPage : (param) => {
    return postRequest('/workingOverTimeAllow/queryPage', param);
  },

  /**
   * 增加  @author  yjg
   */
  add: (param) => {
      return postRequest('/workingHours/add', param);
  },

  /**
   * 修改  @author  yjg
   */
  update: (param) => {
      return postRequest('/workingHours/update', param);
  },


  /**
   * 删除  @author  yjg
   */
  delete: (id) => {
      return getRequest(`/workingHours/delete/${id}`);
  },

  /**
   * 批量删除  @author  yjg
   */
  batchDelete: (idList) => {
      return postRequest('/workingHours/batchDelete', idList);
  },
  
  /**
   * 审批  @author  yjg
   */
  allow: (id,flag) => {
      return getRequest(`/workingHours/allow/${id}/${flag}`);
  },
  
  /**
   * 验证  @author  yjg
   */
  queryByNumberAndDate: (jobNumber,overtimeData) => {
      return getRequest(`/workingHours/queryByNumberAndDate/${jobNumber}/${overtimeData}`);
  },
  
  // 导出工时数据excel
  exportExcel: (param) => {
      return postDownload('/workingHours/exportExcel', param);
  },
  
  /**
   * 批量增加  @author  yjg
   */
  batchAdd: (param) => {
      return postRequest('/workingHours/batchAdd', param);
  },

 /**
   * 预览查询  @author  yjg
   */
  selectPdfDown: (param) => {
      return postRequest('/workingHours/selectPdfDownData', param);
  },
  
  /**
    * 超时预览查询  @author  yjg
    */
   selectPdfOverTime: (param) => {
       return postRequest('/workingHours/selectPdfOverTimeData', param);
   },
  
  /**
   * 工时录入审批修改  @author  yjg
   */
  allowUpdate: (param) => {
      return postRequest('/workinghoursallow/update', param);
  },
  
  /**
   * 加班录入审批修改  @author  yjg
   */
  allowUpdate: (param) => {
      return postRequest('/workingovertimeallow/update', param);
  },
  
  /**
   * 分析  @author  yjg
   */
  analysis: (param) => {
      return postRequest('/workingHours/analysisData', param);
  },
  
  /**
   * 批量审批  @author  yjg
   */
  batchApprove: (idList) => {
      return postRequest('/workingHours/batchApprove', idList);
  },
};
